﻿using System;
using System.ComponentModel;
using System.Reflection;

namespace KD.Sms.UI
{
    public class EnumHelper
    {
        public static string GetEnumDes(object en)
        {
            MemberInfo[] member = en.GetType().GetMember(en.ToString());
            if (member.Length > 0)
            {
                object[] customAttributes = member[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
                if (customAttributes.Length > 0)
                {
                    return ((DescriptionAttribute)customAttributes[0]).Description;
                }
            }
            return en.ToString();
        }
    }

    public enum ButtonOperate
    {
        left,
        middle,
        right
    }

    public enum ThreeStateValue
    {
        Stop = 0,
        Run = 1,
        Error = 2,
    }

    /// <summary>
    /// 流程状态
    /// </summary>
    public enum FlowStateValue
    {
        NotStarted = 0,
        Running = 1,
        Complete = 2,
    }

    /// <summary>
    /// 开关状态
    /// </summary>
    public enum TwoStateValue
    {
        Off = 0,
        On = 1
    }

    public enum InAndOutStyle
    {
        In,
        Out
    }

    /// <summary>
    /// 字体样式
    /// </summary>
    public enum DisplayStyle
    {
        Small,
        Middle,
        Large
    }

    /// <summary>
    /// 标题显示样式
    /// </summary>
    public enum TitleStype
    {
        Top,
        Both,
        Buttom
    }


    /// <summary>
    /// 控件类型
    /// </summary>
    public enum ControlStyle
    {
        /// <summary>
        /// 圆形
        /// </summary>
        Circular = 0,
        /// <summary>
        /// 方形
        /// </summary>
        Rectangular = 1,
    }
    /// <summary>
    /// 控件类型
    /// </summary>
    public enum DeviceRunMode
    {
        /// <summary>
        /// 圆形
        /// </summary>
        Alto = 0,
        /// <summary>
        /// 方形
        /// </summary>
        Manual = 1,
    }

    /// <summary>
    /// 按钮类型
    /// </summary>
    public enum ButtonStyle
    {
        StartStop,
        RightLeft,
        UpperDown,
        OpenClose
    }


    /// <summary>
    /// 
    /// </summary>
    public enum MsgType
    {
        [Description("信息")]
        Information,
        [Description("告警")]
        Waring,
        [Description("错误")]
        Error
    }


    public enum MenuType
    {

        [Description("制样主页")]
        Main,
        [Description("系统设置")]
        SystemManege,
        [Description("数据管理")]
        DataManage,
        [Description("用户管理")]
        UsersManage,
        [Description("检修维护")]
        Maintenance,
        [Description("系统日志")]
        Log,
        [Description("关于")]
        About,
        [Description("基础设置")]
        BaseConfi,
        [Description("IO配置")]
        BaseIO,
        [Description("故障表")]
        BaseError,
        [Description("IO监控")]
        IOMonitor,
        [Description("其他配置")]
        OtherConfig,
        [Description("烘箱数据")]
        DryBox,
        [Description("制样数据")]
        Prepartion
    }

}
